﻿/***************************************************
//  Copyright (c) Premium Tax Free 2011
***************************************************/

using System.ServiceProcess;
using System.Threading;
using PremierTaxFree.PTFLib.Data;

namespace TransferringService
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            SQLWorker.Default.Start(ThreadPriority.Normal);
            SQLWorker.Default.Error += (s, e) =>
            {
                DataAccess.InsertMessageAsync(e.Exception.Message, "TransferringService", eMessageTypes.Error, e.Exception.StackTrace, false);
            };

            ServiceBase[] servicesToRun = new ServiceBase[] { new XmlTransferringService() };
            ServiceBase.Run(servicesToRun);
            SQLWorker.Default.Stop();
        }
    }
}
